<template>
  <view>
    <uni-popup ref="alertDialog" type="dialog">
      <uni-popup-dialog
        :type="msgType"
        cancelText="取消"
        confirmText="去实名"
        title=""
        content="您还未实名认证，请先实名"
        @confirm="dialogConfirm"
        @close="dialogClose"
      ></uni-popup-dialog>
    </uni-popup>
  </view>
</template>
<script>
import { mapGetters } from "vuex";
export default {
  computed: mapGetters(["userInfo"]),
  data() {
    return {
      msgType: "info",
    };
  },
  mounted() {
    this.chaeckRealName();
  },
  methods: {
    chaeckRealName() {
      if (!this.userInfo.idcard && this.userInfo.thirdId==1) {
        this.$refs.alertDialog.open();
      }
    },
    dialogConfirm() {
      uni.navigateTo({
        url: "/pages/realNameAuth/realNameAuth",
      });
    },
    dialogClose() {
      this.$refs.alertDialog.close();
    },
  },
};
</script>
<style scoped lang="less"></style>
